Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 1, 2026

Summary

  • Refactors type system so builtins and custom types share a sequential pool of indices
  • Builtins (Void, Node, String) are emitted first if used, then custom types follow
  • Eliminates index gaps in bytecode (e.g., T0, T1, T3T0, T1, T2)
  • Adds dynamic index width formatting to bytecode dump

Test plan

  • All 720 existing tests pass
  • Snapshot updates show sequential indices without gaps

@zharinov zharinov enabled auto-merge (squash) January 1, 2026 19:27
Changes type system so builtins and custom types share a sequential pool
of indices. Builtins (Void, Node, String) are emitted first if used,
then custom types follow - no reserved slots for unused builtins.

Key changes:
- Add Void, Node, String variants to TypeKind enum
- Remove QTypeId::VOID/NODE/STRING constants and is_builtin() method
- Update TypeTableBuilder to emit builtins as TypeDefs when referenced
- Update bytecode dump to use dynamic index width formatting
- Update TypeScript emitter to use TypeKind checks instead of constants

This eliminates index gaps in bytecode (e.g., T0, T1, T3 → T0, T1, T2).
@zharinov zharinov force-pushed the refactor/sequential-type-indices branch from bc8fa74 to 46ba176 Compare January 1, 2026 19:30
@zharinov zharinov merged commit 034a24b into master Jan 1, 2026
4 checks passed
@zharinov zharinov deleted the refactor/sequential-type-indices branch January 1, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants